#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int main()
{
	int* p = (int*)malloc(20);
	if (p == NULL)
	{
		printf("%s\n",strerror(errno));
		return 1;
	}
	int i = 0;
	for (i = 0; i < 5; i++)
	{
		p[i] = i + 1;
	}
	for (i = 0; i < 5; i++)
	{
		printf("%d ",p[i]);
	}
	int* ptr = realloc(p, 40);
	if (ptr != NULL)
	{
		p = ptr;
	}


	free(p);
	p = NULL;


	return 0;
}